import axios from "@/api/request"

const fastdfs = {
    delete: 'file/fastdfs/delete'
}
const sys = {
    login: "/back/login",
    logout: "/back/logout",
}
const admin = {
    add: "/back/admin/add",
    update: "/back/admin/update",
    delete: "/back/admin/delete",
    findById: "/back/admin/findById",
    search: "/back/admin/search",
    updateStatus: "/back/admin/updateStatus",
    updateRole: "/back/admin/updateRole",
    getAdminName: "/back/admin/AdminName",
    findByAdminName: "/back/admin/findByAdminName",
}
const role = {
    add: "/back/role/add",
    update: "/back/role/update",
    delete: "/back/role/delete",
    findById: "/back/role/findById",
    findAll: "/back/role/findAll",
    search: "/back/role/search",
    updatePermission: "/back/role/updatePermission",
}
const permission = {
    add: "/back/permission/add",
    update: "/back/permission/update",
    delete: "/back/permission/delete",
    findById: "/back/permission/findById",
    findAll: "/back/permission/findAll",
    search: "/back/permission/search",
}
const api = {
    fastdfs_delete(params) {
        return axios.delete(fastdfs.delete, {params})
    },
    sys_login(params) {
        return axios.post(sys.login, params)
    },
    sys_logout(params) {
        return axios.get(sys.logout, {params})
    },

    admin_add(params) {
        return axios.post(admin.add, params)
    },
    admin_update(params) {
        return axios.post(admin.update, params)
    },
    admin_delete(params) {
        return axios.delete(admin.delete, {params})
    },
    admin_findById(params) {
        return axios.get(admin.findById, {params})
    },
    admin_search(params) {
        return axios.get(admin.search, {params})
    },
    admin_updateStatus(params) {
        return axios.post(admin.updateStatus, params)
    },
    admin_updateRole(params) {
        return axios.post(admin.updateRole, params)
    },
    admin_getAdminName(params) {
        return axios.get(admin.getAdminName, {params})
    },
    admin_findByAdminName(params) {
        return axios.get(admin.findByAdminName, {params})
    },



    role_add(params) {
        return axios.post(role.add, params)
    },
    role_update(params) {
        return axios.post(role.update, params)
    },
    role_delete(params) {
        return axios.delete(role.delete, {params})
    },
    role_findById(params) {
        return axios.get(role.findById, {params})
    },
    role_findAll(params) {
        return axios.get(role.findAll, {params})
    },
    role_search(params) {
        return axios.get(role.search, {params})
    },
    role_updatePermission(params) {
        return axios.post(role.updatePermission, params)
    },

    permission_add(params) {
        return axios.post(permission.add, params)
    },
    permission_update(params) {
        return axios.post(permission.update, params)
    },
    permission_delete(params) {
        return axios.delete(permission.delete, {params})
    },
    permission_findById(params) {
        return axios.get(permission.findById, {params})
    },
    permission_findAll(params) {
        return axios.get(permission.findAll, {params})
    },
    permission_search(params) {
        return axios.get(permission.search, {params})
    },


}
export default api
